package cn.iocoder.yudao.module.erp.convert.saleorder;

import cn.iocoder.yudao.module.erp.controller.admin.saleorder.vo.SaleOrderRespVO;
import cn.iocoder.yudao.module.erp.controller.admin.saleorder.vo.SaleOrderSaveReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.saleorder.SaleOrderGoodsDO;
import org.mapstruct.BeanMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface ErpSaleOrderGoodsConvert {
    ErpSaleOrderGoodsConvert INSTANCE = Mappers.getMapper(ErpSaleOrderGoodsConvert.class);
    @BeanMapping(ignoreByDefault = true)
    @Mappings({
            @Mapping(target = "id", source = "id"),
            @Mapping(target = "outNum", source = "outNum"),
            @Mapping(target = "noOutNum", source = "noOutNum")
    })
    SaleOrderGoodsDO convertSelf(SaleOrderGoodsDO bean);

    List<SaleOrderGoodsDO> convertSlefList(List<SaleOrderGoodsDO> beans);

    SaleOrderRespVO.Item convertDO(SaleOrderGoodsDO bean);
    List<SaleOrderRespVO.Item> convertDOList(List<SaleOrderGoodsDO> beans);

    SaleOrderGoodsDO convertRespVO(SaleOrderRespVO.Item bean);
    List<SaleOrderGoodsDO> convertRespVOList(List<SaleOrderRespVO.Item> beans);

    SaleOrderGoodsDO convertSaveVO(SaleOrderSaveReqVO.Item bean);
    List<SaleOrderGoodsDO> convertSaveVOList(List<SaleOrderSaveReqVO.Item> beans);
}
